<template>
  <div id="orderdetails">  

    <el-form ref="form"  label-width="80px">           
          <el-row>
            <el-col :span="12" >  
                <el-page-header @back="goBack"   :content='"详情"'  style="margin-bottom:10px;"></el-page-header>
            </el-col>
          </el-row>
 
        <el-row style="">  

           <el-col :span="12" style="display:flex;">

              <!-- <el-form-item label-width="0px" style="margin-right:10px;">
                <el-select  v-model="form.select_num" placeholder="请选择状态"  @change="select_change">
                    <el-option  v-for="(item,index) in select_data" :key="index" :label="item.name" :value="item.id" ></el-option>
                </el-select>
              </el-form-item> -->

              <el-form-item label-width="0px">
                <el-input v-model="form.input1" placeholder="姓名/手机号" class="search"></el-input>
              </el-form-item>

              <div class="custom_button" @click="sc_but()"></div>
        </el-col>

          <el-col :span="12" style="text-align: right;">  
            <el-button type="primary" class="custom_color_button" style="margin-bottom:10px;"  @click="refresh_but()">刷新</el-button>            
          </el-col>
  

        </el-row>

    </el-form>

   <!-- 渲染数据list -->
   <orderdetails-list :data="data"> </orderdetails-list>
   
     
     <div style="margin-top:10px;text-align: center;">
      <el-pagination
        background
        @current-change="handleCurrentChange"
        :page-size="10"  
        layout="prev, pager, next, jumper"
        :total="count">
      </el-pagination>
    </div>
      
  </div>
</template>

<script>
import OrderdetailsList from '@/view/Order/OrderdetailsList'
export default {
  name: 'orderdetails',
  data () {
    return {
      data:[],
      page:1,
      count:0,
      form:{
          input1:'',
          select_num:'',
      },
      select_data:[{'id':1,"name":'已驳回'},{'id':2,"name":'已完成'},{'id':3,"name":'已拒绝'}]
    }
  },
 components:{
    OrderdetailsList
  },
  created(){
     this.list_fun()
  }, 
  mounted (){
    
  },
  methods: {
     list_fun(){
          this.post("/order/listOfOperationLog", {
              page:this.page,
              type:this.form.select_num,
              account:this.form.input1
	        }).then(res => {
            this.count = res.result.count
            this.data = res.result.list
            //console.log(res)
         })
      },
      sc_but(){
        this.page = 1
        this.list_fun()
      },
     select_change(){
         this.page = 1
         this.list_fun()
     },
     refresh_but(){
         this.form.select_num = ''
         this.form.input1 = ''
         this.page = 1
         this.list_fun()
     },
    goBack() {
        this.$router.go(-1)
    },
     handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
        this.page = val
         this.list_fun()
        console.log(`当前页: ${val}`);
      }
  }
}
</script>


<style scoped>


</style>
